trigger CopyLongNameToShort on Contact (before insert, before update) {
	
	for ( Integer i=0; i < trigger.new.size();i++){

		Contact c = trigger.new[i];
		
		// Check if CustomFirstName is not null and the field has changed
		//
		if (trigger.new[i].Title != null && (trigger.old[i].Title != trigger.new[i].Title)){
			
			//Replace FirstName with substring of CustomFirstName
			c.FirstName = c.Title.substring(0, 50);
		}
	}

}